/*
* Copyright (c) 2014 Qunar.com. All Rights Reserved.
*/
package net.oschina.bilbodai.common.beanutil.property.asm.lexer.parse;

import java.util.StringTokenizer;

/**
 * @author qt-maodai  Date: 15-8-7 Time: 上午12:27
 * @version $Id$
 */
public class StringTokenizerIterator implements ITokenIterator {

    private final StringTokenizer tokenizer;
    private final String token;
    public StringTokenizerIterator(String string) {
        this.token = string;
        this.tokenizer = new StringTokenizer(string, ".[]", false);
    }

    @Override
    public String token() {
        return token;
    }

    public boolean hasNext() {
        return tokenizer.hasMoreTokens();
    }

    public String nextToken() {
        return tokenizer.nextToken();
    }

}